Skip to content

Fix a problem with functions with the same name crashing the dependency graph. #1674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 20, 2017

Conversation

NlightNFotis
Copy link
Contributor

Before this patch, two static functions with the same name but in different files would cause goto-analyzer to fail with an assertion violation:

goto-analyzer: dependence_graph.cpp:119: void dep_graph_domaint::control_dependencies(goto_program_templatet<codet, exprt>::const_targett, goto_program_templatet<codet, exprt>::const_targett, dependence_grapht&): Assertion `e!=pd.cfg.entry_map.end()' failed.

The problem was that one of these two clashing functions had its symbol renamed (added a $link1 postfix to its name), but the corresponding instructions of the function were not getting updated accordingly (instructionts contain a field called function, which is an irep_idt referring to the function that the instruction belongs to).

Pinging @martin-cs and @chrisr-diffblue for review.

@tautschnig
Copy link
Collaborator

Good catch! Would it be possible to add a test? Likely that test just needs to use —show-dependence-graph.

@martin-cs
Copy link
Collaborator

Looks good please add the original regression test and this should be good to merge. The equivalent PR against develop would also be useful.

{
irep_idt final_id=dest_it->first;
rename_symbols_in_function(dest_it->second, final_id, macro_application);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is necessary, the cases of renamed functions should all be caught above.

@martin-cs
Copy link
Collaborator

Apologies for the merge while commenting. The goto-analyze-develop branch will hopefully soon be gone in favour of moving stuff into master so as long as it is fixed in #1677, all should be well.

@tautschnig
Copy link
Collaborator

Apologies for the merge while commenting.

You couldn't possibly have known :-)

martin-cs added a commit that referenced this pull request Jan 10, 2018
Port #1674 to develop (Fix a problem with functions with the same name crashing the dependency graph.)
@NlightNFotis NlightNFotis deleted the test_pb4_fix branch February 19, 2021 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants